#-*- coding:utf-8 -*-
import sys
from PySide2.QtWidgets import *
from PySide2.QtGui import *
from asset_widget.upload_window import Upload
from asset_widget.search_window import Search


class MZ_Assets(QWidget):

    def __init__(self):
        super(MZ_Assets, self).__init__()

        self.setWindowTitle("资产库")
        self.setStyleSheet('background-color:rgb(75,75,75);color:rgb(220,220,220)')

        self.mainLayout = QHBoxLayout()
        self.mainLayout.setContentsMargins(50,50,50,50)
        self.mainLayout.setSpacing(50)

        self.upload_btn = QPushButton('上传资产')
        self.upload_btn.setFont(QFont('',20,75))
        self.upload_btn.setMinimumSize(150, 50)
        self.upload_btn.clicked.connect(self.__openUploadWindow)
        self.download_btn = QPushButton('查询资产')
        self.download_btn.setMinimumSize(150, 50)
        self.download_btn.clicked.connect(self.__openSearchWindow)

        self.mainLayout.addWidget(self.upload_btn)
        self.mainLayout.addWidget(self.download_btn)

        self.setLayout(self.mainLayout)


    def __openUploadWindow(self):
        self.up_load_window=Upload()
        self.up_load_window.show()
        self.close()

    def __openSearchWindow(self):
        self.search_window=Search()
        self.search_window.show()
        self.close()

if __name__ == '__main__':
    app=QApplication()
    mz=MZ_Assets()
    mz.show()
    sys.exit(app.exec_())